<?php echo $this->fetch('header.html'); ?>
<link href="templates/style/left.css" rel="stylesheet" type="text/css" />
<div id="menu-list">
    <ul id="menu-ul">
        <?php $_from = $this->_var['back_nav']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('key', 'menu');if (count($_from)):
    foreach ($_from AS $this->_var['key'] => $this->_var['menu']):
?>
        <li class="collapse">
            <div class="menu_a"><em class="iconfont <?php echo $this->_var['key']; ?>_ico"></em><?php echo $this->_var['menu']['text']; ?><i></i></div>
            <ul style="display:none;">
                <?php $_from = $this->_var['menu']['children']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('sub_key', 'sub_menu');if (count($_from)):
    foreach ($_from AS $this->_var['sub_key'] => $this->_var['sub_menu']):
?>
                <li class="menu-item"><a href="<?php echo $this->_var['sub_menu']['url']; ?>" target="main-frame"><?php echo $this->_var['sub_menu']['text']; ?></a></li>
                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
            </ul>
        </li>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </ul>
</div>
<script>
    $(function() {
        $(".menu_a").click(function() {
            if($(this).hasClass('menu_plus')){
                $(this).removeClass("menu_plus");
                $(this).parent().children("ul").hide();
            }else{
                $(this).addClass("menu_plus");
                $(this).parent().children("ul").show();
            }
        });
    });
</script>